<template>
    <div class="bgf mart20" v-loading="loading" >
        <el-table :data="list" > 
            <el-table-column prop="logId" fixed min-width="80" label="身份ID"> </el-table-column>

            <el-table-column prop="username" min-width="140" label="管理员姓名"> </el-table-column>

            <el-table-column prop="introduce" min-width="180" label="请求内容" show-overflow-tooltip> </el-table-column>

            <el-table-column prop="requestType" min-width="100" label="请求方式"> </el-table-column>

            <el-table-column prop="createTime" width="180" label="请求时间"> </el-table-column>
        </el-table>
        <div class="h70 pad20 flexab ">
            <p class="font10 cola4">共 {{total}} 条</p>
            <el-pagination
                v-model:currentPage="param.pageNumber"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :page-sizes="[10, 15, 20, 25]"
                :page-size="param.pageSize"
                layout=" sizes, prev , jumper , next"
                :total="total">
            </el-pagination>
        </div>
    </div>
  
</template>
<script>
export default {
    data(){
        return{
            loading: false,
            param:{
                pageNumber:1,
                pageSize: 10,
            },
            list:[],
            total:0,
        }
    },
    mounted(){
        this.getList()
    },
    methods:{
        
        getList(pageNumber){
            if(pageNumber){
                this.param.pageNumber = pageNumber;
            }
            this.loading = true;
            console.log(this.param)
            this.$api.initOperationLogPage(this.param).then(res=>{
                console.log(res);
                if(res){
                    this.list = res.records
                    this.total = res.total;
                }
                this.loading = false;
            })
        },

        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
            this.param.pageSize = val;
            this.getList();
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.param.pageNumber = val;
            this.getList();
        },
    }
}
</script>
<style lang="scss" scoped>
.graytxt{
    font-size: 12px;
    color: #9e9e9e;
    padding: 14px 0 0 100px;
}
.add{
    label{
        width: 160px;
        display: inline-block;
        text-align: right;
    }
}
</style>
